package com.sdry.mapper.cb;

import com.sdry.model.cb.DepreciationEntity;
import com.sdry.model.cb.ShareEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

public interface AmoebaMapper {

    //叉车，扫地车折旧
    List<DepreciationEntity> chaCheZheJiu(String date);

    // 折旧费用去除掉叉车扫地车
    List<DepreciationEntity> zheJiuFie(String date);

    //叉车租赁
    @Select("select ISNULL(sum(monery), 0) as monery from c_Forkli_t where type = '租赁' and datediff(month,createDate,getdate())=0 and brand like '%叉车%'")
    BigDecimal cheCheZuLin(String date);

    //其他
    @Select("select ISNULL(sum(monery), 0) as monery from cb_otherCost_t where datediff(month,createDate,#{date})=0  and del = 0")
    BigDecimal qiTa(String date);

    //查询底薪总和
    BigDecimal gongZi(String date);
    //查询月过桥费总和
    BigDecimal guoQiaoFei(String date);
    //-查询月油费总和
    BigDecimal youFei(String date);
    //查询月维修费总和
    BigDecimal weiXiuFei(String date);
    //查询月外雇车总和
    BigDecimal waiGuChe(String date);
    //查询月服务费总和
    BigDecimal fuWuFei(String date);
    //查询月社保费总和
    BigDecimal sheBaoFei(String date);
    //待摊
    BigDecimal daiTanFei(@Param("date") String date, @Param("warehouseId") Long warehouseId);

    @Select("select * from zy_share , ( SELECT id AS wid, warehouse_name warehouseName FROM lz_warehouse WHERE status = 0 ) t1  where  flag = 1  and warehouseid = t1.wid")
    List<ShareEntity> getShareList(String date,Long warehouseId);
}
